/* eslint-disable @typescript-eslint/no-var-requires */
const fs = require('fs');
const path = require('path');
const svgDir = path.join(__dirname, 'dist', 'svg');
fs.readdirSync(svgDir, { withFileTypes: true }).forEach((f) => {
	if (f.isFile() && /\.svg$/.test(f.name)) {
		const svgFile = path.join(svgDir, f.name);
		const svg = fs.readFileSync(svgFile, 'utf-8').replace(/>\s+</gm, '><').replace(/\s+/g, ' ');
		fs.writeFileSync(svgFile, svg, 'utf-8');
	}
});
